package com.littlec.sdk.entity;

public class CMContact {
	private String userName;
	private String name;
	private String phoneNumber;

	public void setUserName(String uname) {
		this.userName = uname;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return (this.name == null) || (this.name.isEmpty()) ? this.userName
				: this.name;
	}

	public String getPhoneNumber() {
		return this.phoneNumber;
	}

	public void setPhoneNumber(String phone_number) {
		this.phoneNumber = phone_number;
	}

	public int hashCode() {
		int prime = 31;
		int result = 1;
		result = 31 * result
				+ (this.userName == null ? 0 : this.userName.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CMContact other = (CMContact) obj;
		if (this.userName == null) {
			if (other.userName != null)
				return false;
		} else if (!this.userName.equals(other.userName))
			return false;
		return true;
	}
}
